package com.ist412.pocke;

import java.util.ArrayList;
import java.io.Serializable;

public class Workout implements Serializable {
	
	private static final long serialVersionUID = 0L;
	
	private ArrayList<Exercise> 	_exercises;
	private String 					_name, _note;
	private boolean 				_scheduled;
	private int						_hour, _minute;
	private boolean[]				_schedule = { false, false, false, false, false, false, false };
	
	public Workout() {
		_name		= "workout";
		_note		= "";
		_exercises 	= new ArrayList<Exercise>();
		_scheduled 	= false;
		_hour		= -1;
		_minute		= -1;
	}
	
	public Workout(ArrayList<Exercise> exercises) {
		_name 		= "workout";
		_note		= "";
		_exercises 	= exercises;
		_scheduled	= false;
		_hour		= -1;
		_minute		= -1;
	}
	
	public Workout(String name, ArrayList<Exercise> exercises) {
		_name 		= name;
		_note		= "";
		_exercises 	= exercises;
		_scheduled	= false;
		_hour		= -1;
		_minute		= -1;
	}
	
	public final ArrayList<Exercise> getExercises() {
		return _exercises;
	}
	
	public final String getName() {
		return _name;
	}
	
	public final int getHour() {
		return _hour;
	}
	
	public final int getMinute() {
		return _minute;
	}
	
	public final String getNote() {
		return _note;
	}
	
	public final boolean[] getSchedule() {
		return _schedule;
	}
	
	public final boolean isScheduled() {
		return _scheduled;
	}
	
	public final void setExercises(ArrayList<Exercise> newExercises) {
		_exercises = newExercises;
	}
	
	public final void setName(String name) {
		_name = name;
	}
	
	public final void setNote(String note) {
		_note = note;
	}
	
	/**
	 * @param days	Boolean string in format t/f {sunday, monday, tuesday, wednesday, thursday, friday, saturday}
	 * @param hour
	 * @param minute
	 */
	public final void setSchedule(boolean[] days, int hour, int minute) {
		_scheduled 	= true;
		_schedule 	= days;
		_hour 		= hour;
		_minute 	= minute;
	}
	
	public final void clearSchedule() {
		_scheduled 	= false;
		_schedule	= new boolean[] { false, false, false, false, false, false, false };
		_hour 		= -1;
		_minute		= -1;
	}
	
} // end class Workout